package com.example.pixelyear.sql;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class Sql extends SQLiteOpenHelper {
    public static final String recordName = "record";
    private final String record = "create table if not exists " + recordName + "(_id integer primary key autoincrement," +
            "color integer ,year integer,month integer,day integer , textColor integer , mood text)";

    public static final String noteName = "note";
    private final String note = "create table if not exists " + noteName + "(_id integer primary key autoincrement," +
            "date text," + "note text" + ")";

    public static final String colorName = "color";
    private final String color = "create table if not exists " + colorName + "(_id integer primary key autoincrement," +
            "color integer," + "msg text," + "position integer" + ")";

    public Sql(Context context) {
        super(context, "yxs.db", null, 1);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(record);
        db.execSQL(note);
        db.execSQL(color);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
